package com.zan.principles.demo3.before;

/**
 * @Author Zan
 * @Create 2024/4/22 21:18
 * @Description : TODO(请用一句话描述该类的功能)
 * @ClassName: Demo
 */
public class ComputerDemo {
    public static void main(String[] args) {
        // 创建组件对象
        XiJieHardDisk hardDisk = new XiJieHardDisk();
        IntelCpu cpu = new IntelCpu();
        KingstonMemory memory = new KingstonMemory();

        // 创建计算机对象
        Computer computer = new Computer();
        // 组装计算机
        computer.setHardDisk(hardDisk);
        computer.setCpu(cpu);
        computer.setMemory(memory);

        // 运行计算机
        computer.run();
    }
}
